package com.itheima.reggie.mapper;

import com.itheima.reggie.dto.OrderDto;
import com.itheima.reggie.entity.OrderDetail;
import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 黑马程序员
 */
public interface OrderMapper {


    @Insert("insert into orders values(#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Orders orders);
    List<Orders> findByPage(@Param("number") String number,
                            @Param("beginTime") LocalDateTime beginTime,
                            @Param("endTime")LocalDateTime endTime);

    List<OrderDto> findByUserPage(@Param("userId") Long userId);


}
